<form id="<?php echo $uniqid;?>" method="post" style="padding: 8px;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr>
            <td class="tlabel" width="20%">名称：</td>
            <td width="80%"><input type="text" style="width:200px;"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入名称.." required="true" v-model="params.name"></td>
        </tr>
        <tr>
            <td class="tlabel" width="20%">奖励加权比例：</td>
            <td width="80%">
                <div class="display-flex" style="width: 200px; height: 40px;">
                <el-input size="mini" type="number"
                          @input="inputChange" v-model="params.rate" v-enter-number>
                    <template slot="append">%</template>
                </el-input>
                </div>
            </td>
        </tr>
    </table>
</form>

<script>
    var taskmembereditVm =  new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: JSON.parse("<?php echo addslashes($dataset);?>"),
        },
        methods:{
            inputChange() {
                this.$forceUpdate();
            },
            submit(){
                let act = taskmembereditVm.params.id>0 ? 'edit' : 'add';
                $.post('/admin/taskmember/'+act, taskmembereditVm.params, function (data) {
                    if (parseInt(data.ret) === 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $("#taskmemberDlg").dialog('close');
                        $("#taskmember").datagrid('reload');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            },
            rm() {
                $.messager.confirm('确认对话框', '您确认删除么？', function (r) {
                    if (r) {
                        taskmembereditVm.params.image = '';
                    }
                });
            }
        }
    });
    $(function(){
        $('#taskmemberEditsubmit').click(function(){
            taskmembereditVm.submit();
        })
    });
</script>
